package se.webbzon.oschi01.nbt;

import se.webbzon.oschi01.nbt.TagEvent.Action;

public class DoubleTag extends AbstractTag<Double> {
	
	private double d;
	
	public DoubleTag(TagFactory<Double> factory, String tagName, double d) {
		super(factory, tagName);
		this.d = d;
	}

	@Override public long size() {
		return 8;
	}

	@Override public Double getValue() {
		return d;
	}

	@Override public void setValue(Double value) {
		this.d = value;
		broadcastEvent(new TagEvent(this,Action.CHANGED,value));
	}

	@Override public Class<Double> getValueClass() {
		return Double.class;
	}

	@Override public AbstractTag<Double> clone() {
		return new DoubleTag(getFactory(),this.toString(),d);
	}

}
